package com.parking.gateway.config;

import org.springframework.stereotype.Component;
import springfox.documentation.swagger.web.SwaggerResource;
import springfox.documentation.swagger.web.SwaggerResourcesProvider;


import java.util.Arrays;
import java.util.List;

@Component
public class SwaggerResourceConfig implements SwaggerResourcesProvider {
    @Override
    public List<SwaggerResource> get() {
        return Arrays.asList(
            add("/user/v2/api-docs","用户模块"),
            add("/renters/v2/api-docs","出租客模块"),
            add("/platform/v2/api-docs","平台模块"),
            add("/certified/v2/api-docs","物业模块"),
            add("/stall/v2/api-docs","车位模块"),
            add("/order/v2/api-docs","订单模块")
        );
    }

    private SwaggerResource add(String url, String name){
        SwaggerResource swaggerResource = new SwaggerResource();
        swaggerResource.setName(name);
        swaggerResource.setUrl(url);
        swaggerResource.setSwaggerVersion("2.0");
        return swaggerResource;
    }
}
